package com.woniu.his.dao;

import com.woniu.his.entity.HospitalizationInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author TATO
 * @since 2019-11-25
 */
public interface HospitalizationInfoMapper extends BaseMapper<HospitalizationInfo> {
    //这是查询未处理的入院表信息
    List<Map<String, Object>> taoFindAllHospitalApplyStatusFalseInfo();

    @Select("select p.patient_name, s.section_name, h.* " +
            "from hospitalization_info h " +
            "left join " +
            "medical_info m on " +
            "h.medical_id = m.medical_id\n" +
            "left join\n" +
            "patient_info p on\n" +
            "m.patient_id = p.patient_id\n" +
            "left join\n" +
            "section_info s on\n" +
            "h.section_id = s.section_id\n" +
            "where h.status=1 and h.is_out=0")
    List<Map> queryAllInhospitalInfo();

    //这是查询要办理出院的住院表信息
    List<Map<String, Object>> taoFindAllOutHospitalApplyInfo();

    //这是查询药品申请单属于住院的表
    List<Map<String, Object>> taoFindAllDrugApplyByMedicalIsHospitalization();
}












